package unit_4;

public class Employee {
    String name;
    int age;
    double salary;
    public Employee(){ //无参数构造方法
    }
    public  Employee(String n, int a, double s){ //带参数的构造方法
        this.name = n;
        this.age = a;
        this.salary = s;
    }
    public void sayHello(){  //一个实例方法
        System.out.println("My name is " + name);
    }
    public double computeSalary(int hours, double rate) {  //另一个实例方法
        return salary + hours * rate;
    }
}
